package com.example.order_engine.domain.model;

import jakarta.persistence.Embeddable;
import jakarta.persistence.Transient;
import java.util.HashMap;
import java.util.Map;

/**
 * 订单额外信息值对象
 */
@Embeddable
public class OrderExtraInfo {
    
    @Transient
    private Map<String, Object> extraParams;

    public OrderExtraInfo() {
        this.extraParams = new HashMap<>();
    }
    
    public OrderExtraInfo(Map<String, Object> extraParams) {
        this.extraParams = extraParams != null ? extraParams : new HashMap<>();
    }

    public Object getParam(String key) {
        return extraParams.get(key);
    }

    public void setParam(String key, Object value) {
        extraParams.put(key, value);
    }

    public Map<String, Object> getExtraParams() {
        return extraParams;
    }
}